package com.pos43.domain;

import java.util.HashSet;
import java.util.Set;


public class User {

		private Integer id;
		private String username;
		private String pwd;
		private Integer power;
		Set<Orders> orders = new HashSet<Orders>();
		Set<Returns> returns = new HashSet<Returns>();
		
		public User(){
			
		}

		public User(Integer id, String username, String pwd, Integer power, Set<Orders> orders, Set<Returns> returns) {
			this.id = id;
			this.username = username;
			this.pwd = pwd;
			this.power = power;
			this.orders = orders;
			this.returns = returns;
		}

		public Integer getId() {
			return id;
		}

		public void setId(Integer id) {
			this.id = id;
		}

		
		public String getUsername() {
			return username;
		}

		public void setUsername(String username) {
			this.username = username;
		}

		public String getPwd() {
			return pwd;
		}

		public void setPwd(String pwd) {
			this.pwd = pwd;
		}

		public Integer getPower() {
			return power;
		}

		public void setPower(Integer power) {
			this.power = power;
		}

		public Set<Orders> getOrders() {
			return orders;
		}

		public void setOrders(Set<Orders> orders) {
			this.orders = orders;
		}
		
		
		public Set<Returns> getReturns() {
			return returns;
		}

		public void setReturns(Set<Returns> returns) {
			this.returns = returns;
		}

		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + ((id == null) ? 0 : id.hashCode());
			result = prime * result + ((pwd == null) ? 0 : pwd.hashCode());
			return result;
		}

		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			User other = (User) obj;
			if (id == null) {
				if (other.id != null)
					return false;
			} else if (!id.equals(other.id))
				return false;
			if (pwd == null) {
				if (other.pwd != null)
					return false;
			} else if (!pwd.equals(other.pwd))
				return false;
			return true;
		}

		
		
		
}
